<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
//     // 对象函数属性简写
// let person = {
//     name: "cyl",
//     //以前：
//     eat: function (food) {
//         console.log(this.name + "在吃" + food);
//     },
//     //现在：这里拿不到this
//     eat: food => console.log(person.anme + "在吃" +food),
//     eat(food){
//         console.log(this.name + "在吃" + food);
//     }
// }


//箭头函数结合解构表达式
//以前：
const person = {
    name: "cyl",
    age: 22,
    language: ['java','HTML','javaScript']
}
function hello(person) {
    console.log("hello", + person.name);
}
//现在：
var hello = ({name}) => console.log("hello", + name);
hello(person);

</script>